package com.cxso.example.request.sign;


import com.cxso.example.domain.sign.SignerInfoDomain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Getter
@Setter
@Schema(description = "关键字签章")
public class SignSealByKeywordRequest {


    @Schema(description = "签署人信息", example = "如果签署人前期没有申请证书，此时系统自动帮助用户申请证书，但是这样效率较差，建议前期帮助用户申请好证书")
    @NotNull(message = "签署人信息不能为空")
    @Valid
    private SignerInfoDomain signerInfo;

    @Schema(description = "合同编号")
    @NotBlank(message = "合同编号不能为空")
    private String contractNum;

    @Schema(description = "合同是否签署完成", example = "(0:是,1:否)")
    @NotNull(message = "合同是否签署完成不能为空")
    private Integer isFinish;

    @Schema(description = "签章规则")
    @NotNull(message = "签章规则不能为空")
    @Valid
    private RuleInfo ruleInfo;

    @Getter
    @Setter
    public static class RuleInfo {
        @Schema(description = "签名类型", example = "1签名 2印章")
        private String signType;

        @Schema(description = "签章或者签字ID", example = "如果不指定，则用户默认设置")
        private String signId;

        @Schema(description = "甲方")
        private String keyWord;

        @Schema(description = "查找开始页", example = "大于等于1")
        private String beginPage;

        @Schema(description = "查找结束页", example = "大于等于-3小于等于beginPage，-1、-2、-3分别代表倒数第一、第二、第三页")
        private String endPage;

        @Schema(description = "排序", example = "正序ASC，倒序DESC")
        private String orderBy;

        @Schema(description = "盖章个数", example = "大于等于1")
        private String sealNum;

        @Schema(description = "盖章位置偏移", example = "负数向左移动，正数向右移动")
        private String x;

        @Schema(description = "盖章位置偏移", example = "负数向下移动，正数向上移动")
        private String y;
    }
}
